﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using System.Data;

public partial class top_review_js_isshow : System.Web.UI.Page
{
    public string msg = string.Empty;

    protected void Page_Load(object sender, EventArgs e)
    {
        Cookie cookie = new Cookie();
        string taobaoNick = cookie.getCookie("nick");

        Rijndael_ encode = new Rijndael_("tetesoft");
        taobaoNick = encode.Decrypt(taobaoNick);

        string sql = "SELECT * FROM TCS_ShopConfig r WITH (NOLOCK) INNER JOIN TCS_ShopSession s WITH (NOLOCK) ON s.nick = r.nick AND couponid IS NOT NULL AND LEN(couponid) > 10 INNER JOIN TCS_Coupon c ON CAST(C.guid as Nvarchar(40)) = CAST(r.couponid as Nvarchar(40)) WHERE c.enddate < GETDATE() AND phone IS NOT NULL AND iscoupon = 1 AND couponid IS NOT NULL AND r.isdel = 0 AND r.nick = '" + taobaoNick + "'";

        DataTable dt = utils.ExecuteDataTable(sql);
        if (dt.Rows.Count != 0)
        {
            msg = "<b style=color:red;font-size:14px;margin-top:4px;>";
            msg += "好评有礼友情提醒：";
            //提示优惠券过期
            msg += "1、您在基本设置里面设置的优惠券已经到期，<a href='/top/reviewnew/couponmodify.aspx?id=" + dt.Rows[0]["couponid"].ToString() + "' target='mainframe2'>点击修改优惠券截至赠送日期</a>";
            msg += "</b>";
        }
    }
}